<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<script type="text/javascript" src="${webRoot}/plug-in/fancybox/fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
<script type="text/javascript" src="${webRoot}/plug-in/fancybox/fancybox/jquery.fancybox-1.3.4.js"></script>
<link rel="stylesheet" type="text/css" href="${webRoot}/plug-in/fancybox/fancybox/jquery.fancybox-1.3.4.css" media="screen" />
<style type="text/css">
  /*    .datagrid-cell img{
          width: 60px;
          height: 60px;
      }*/
</style>
<div id="main_depart_list" class="easyui-layout" fit="true">
  <div region="center" style="padding: 1px;">
    <t:datagrid name="categoryList" title=""
                actionUrl="articleCategoryController.do?datagrid"
                treegrid="true" idField="id" pagination="false">
      <t:dgCol title="common.id" field="id" treefield="id" hidden="true" ></t:dgCol>
      <t:dgCol title="标题" field="title" treefield="text" width="100"></t:dgCol>
      <t:dgCol title="副标题或别名" field="subtitle" treefield="fieldMap.subtitle" width="100"></t:dgCol>
      <t:dgCol title="展示平台" field="publishPlat" treefield="fieldMap.publishPlat" width="100" dictionary="supportSys"></t:dgCol>
      <t:dgCol title="创建时间" field="createTime" treefield="src" formatter="yyyy-MM-dd hh:mm:ss" width="80"></t:dgCol>
      <t:dgCol title="common.operation" field="opt" width="80"></t:dgCol>
      <t:dgDelOpt url="articleCategoryController.do?delete&id={id}" title="common.delete"></t:dgDelOpt>
      <%--<t:dgCol title="common.operation" field="opt"></t:dgCol>--%>

    </t:datagrid>
    <%--添加与修改、删除不开放--%>
    <div id="categoryListtb" style="padding: 3px; height: 25px">
      <div style="float: left;">
        <a href="#" class="easyui-linkbutton" plain="true" icon="icon-add" onclick="addOrg()"><t:mutiLang langKey="添加分类" langArg="商品分类"/></a>
        <a href="#" class="easyui-linkbutton" plain="true" icon="icon-edit" onclick="f_update()"><t:mutiLang langKey="修改分类" langArg="商品分类"/></a>
      </div>
    </div>
  </div>
</div>


<script type="text/javascript">
  $(function() {
    var li_east = 0;
  });
  function LogoFormatter(val,row){
    return '<a rel="datagrid_group" href="'+val+'" title=""><img alt="" src="'+val+'" width="30px" heigth="30px"></a>';
  }
  function bandImg(){
    $("a[rel=datagrid_group]").fancybox({
      'overlayShow'	: false,
      'transitionIn'	: 'elastic',
      'transitionOut'	: 'elastic'
    });
  }
  function addOrg() {
    var id = "";
    var rowsData = $('#categoryList').datagrid('getSelections');
    if (rowsData.length == 1) {
      id = rowsData[0].id;
    }
    var url = "articleCategoryController.do?addorupdate&pid="+id;
    add('<t:mutiLang langKey="添加分类" langArg="添加文章分类"/>', url, "categoryList",710,360);
  }

  function f_update(){
    var id = "";
    var rowsData = $('#categoryList').datagrid('getSelections');
    if (rowsData.length == 1) {
      id = rowsData[0].id;
    }else{
      tip("请选择一条进行编辑");
      return false;
    }
    var url = "articleCategoryController.do?addorupdate&id="+id;
    add('<t:mutiLang langKey="修改分类" langArg="修改文章分类"/>', url, "categoryList",710,360);
  }

  //    function f_addordelGoods(categoryId){
  //
  ////        url="goodsCategoryController.do?addordelGoods&id={id}"
  //        openwindow("设置商品","goodsCategoryController.do?addordelGoods&categoryId="+categoryId,"goodsFullList",750,600);
  //
  //    }

</script>